An entity relationship (ER) diagram is a graphical representation of an organization's data storage requirements. Entity relationship diagrams are abstractions of the real world which simplify a problem to be solved while retaining its essential features. Entity relationship diagrams have three different components: entities, attributes and relationships. Entities are the people, places, things, events and concepts of interest. Entities may represent collections of things, for example, an employee entity might represent a collection of all the employees that work for an organization. Individual members (employees) of the collection are called occurrences of the employee entity.
Entities are further described by their attributes or data elements. These are the smallest units of data that can be described in a meaningful manner. For example, an employee entity may have the following attributes: employee number, last name, first name, date of birth, telephone number, department, etc. Frequently, a meaningful relationship exists between two different types of entity. For example: employees work in a department, lawyers advise clients, equipment is allocated to projects, truck is a type of vehicle, etc.
There are potentially three types of relationships which can exist between two different entities: one-to-one, one-to-many and many-to-many relationships. A one-to-one relationship is when a single occurrence of an entity is related to just one occurrence of a second entity. For example, a roof covers one building; a building is covered by one roof. One-to-many relationships are when a single occurrence of an entity is related to many occurrences of a second entity. For example, an employee works in one department; a department has many employees. Many-to-many relationships are when many occurrences of an entity are related to many occurrences of a second entity. For example, equipment is allocated to many projects; a project is allocated many items of equipment.
Another problem is that while building queries or asking questions against an ER model is difficult. there is a desire to maintain power and flexibility in the questions that may be asked. ER models are extremely flexible in the ways that entities can be related to other entities. With this flexibility comes complexity especially when trying to formulate queries or questions against this model. The problem is magnified when the individual trying to formulate the query is not familiar with relational design.